package org.ddd.orderdemo.shared.event.spring.publish;

import org.ddd.orderdemo.shared.event.spring.BizEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;

public class BizEventPublisher {

    private ApplicationEventPublisher appEventPublisher;

    private ApplicationContext applicationContext;

    public void publish(BizEvent bizEvent) {

        appEventPublisher.publishEvent(bizEvent);
    }

    public void publish2(BizEvent bizEvent) {

        applicationContext.publishEvent(new Object());
        applicationContext.publishEvent(bizEvent);
    }

}
